ac94fe95d5059bd6f255e841413b2246c449fc1c,opennms-services/src/test/java/org/opennms/netmgt/syslogd/SyslogdTest.java,SyslogdTest,testSubstrTESTTestThatRemovesATESTString,#,234

Before Change


    }
    
    public void testSubstrTESTTestThatRemovesATESTString() throws InterruptedException {
    	String localhost = myLocalHost();
    	final String testPDU = "2007-01-01 www.opennms.org A CISCO message that is also a TEST message -- hide me!";
    	final String testUEI = "uei.opennms.org/tests/syslogd/substrUeiRewriteTest";
    	final String testMsg = ConvertToEvent.HIDDEN_MESSAGE;
    	
        Event e = new Event();
        e.setUei("uei.opennms.org/tests/syslogd/substrUeiRewriteTest");
        e.setSource("syslogd");
        e.setInterface(localhost);
        Logmsg logmsg = new Logmsg();
        logmsg.setDest("logndisplay");
        logmsg.setContent(testMsg);
        e.setLogmsg(logmsg);

        EventAnticipator ea = new EventAnticipator();
        ea.anticipateEvent(e);
        
        SyslogClient s = null;
        try {
            s = new SyslogClient(null, 10, SyslogClient.LOG_DEBUG);
            s.syslog(SyslogClient.LOG_DEBUG, testPDU);
        } catch (UnknownHostException uhe) {
            //Failures are for weenies
        }
        
        assertEquals(1, ea.waitForAnticipated(1000).size());
        Thread.sleep(2000);
        assertEquals(0, ea.unanticipatedEvents().size());
        
        assertFalse(ea.getAnticipatedEvents().isEmpty());
        
        Event ne = (Event) ea.getAnticipatedEvents().iterator().next();
        assertEquals(testUEI, ne.getUei());
        assertEquals("syslogd", ne.getSource());
        assertEquals(testMsg, ne.getLogmsg().getContent());    

After Change


    }
    
    public void testSubstrTESTTestThatRemovesATESTString() throws Exception {
        doMessageTest("2007-01-01 localhost A CRISCO message that is also a TESTHIDING message -- hide me!",
                      myLocalHost(), "uei.opennms.org/tests/syslogd/substrUeiRewriteTest",
                      ConvertToEvent.HIDDEN_MESSAGE);
    }
    
    public void testRegexTESTTestThatRemovesADoubleSecretString() throws Exception {